<?php

class PriceAction extends Action 
{
	public function index()
	{
		$Price=D("Price");
		$count=$Price->count();
		import("ORG.Util.Page");
		$listRows=10;
		$p=new page($count,$listRows);
		$list=$Price->findAll(null,'*','orderid asc',$p->firstRow.','.$p->listRows);
		$page=$p->show();
		if ($list!==false) 
		{
			$this->assign('page',$page);
			$this->assign('list',$list);
		}		
		$this->display();		
	}
	public function detail()
	{
		$id=isset($_GET['id'])?(int)($_GET['id']):0;
		if($id==0)
		{
			$url=__APP__.'/Index';
			redirect($url);return;
		}
		$temp=D("Price")->find($id);
		$this->assign('info',$temp);
		$this->display();		
	}
	public function _empty()
	{
		$url=ACTION_NAME;
		if($url=='')
		{
			$url=__APP__.'/Index';
			redirect($url);return;
		}
		$condition['url']=$url;
		$temp=D("Price")->find($condition);
		$this->assign('info',$temp);
		$this->display('detail');		
	}	
}
?>